#include<bits/stdc++.h>
#define endl '\n'
#define debug(x) cerr<<#x<<':'<<x<<endl
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
const int N=2e5+5;
int n;
int a[N],b[N];
int lg2[N];
int dpa[N][25],dpb[N][25];
void init(){
    for(int i=2;i<N;i++) lg2[i]=lg2[i/2]+1;
    for(int i=1;i<=n;i++) dpa[i][0]=a[i];
    for(int i=1;i<=n;i++) dpb[i][0]=b[i];
    for(int j=1;j<=lg2[n];j++)
        for(int i=1;i+(1<<j)-1<=n;i++)
            dpa[i][j]=min(dpa[i][j-1],dpa[i+(1<<(j-1))][j-1]),
            dpb[i][j]=min(dpb[i][j-1],dpb[i+(1<<(j-1))][j-1]);
            
}
int aska(int l,int r){
    int k=lg2[r-l+1];
    return min(dpa[l][k],dpa[r-(1<<k)+1][k]);
}
int askb(int l,int r){
    int k=lg2[r-l+1];
    return min(dpb[l][k],dpb[r-(1<<k)+1][k]);
}
signed main(){
	freopen("min.in","r",stdin);
	freopen("min.out","w",stdout);
    cin>>n;
    int tsxz=1,tsxz2=1,mi=INT_MAX,mx=INT_MIN,pos;
    for(int i=1;i<=n;i++){
        cin>>a[i],mi=min(mi,a[i]);
        if(a[i]>mx) mx=a[i],pos=i;
    }
    for(int i=1;i<=n;i++){
        cin>>b[i];
        if(b[i]!=1) tsxz=0;
        if(b[i]!=1e9) tsxz2=0;
    }
    if(tsxz){
        for(int i=1;i<=n;i++) cout<<mi-1<<endl;
        return 0;
    }
    init();
    for(int k=1;k<=n;k++){
        int res=INT_MAX;
        for(int i=1;i+k-1<=n;i++){
            int l=i,r=i+k-1;
            res=min(res,abs(aska(l,r)-askb(l,r)));
        }cout<<res<<endl;
    }
    return 0;
}